
<div id="main_content">
	<h1>Playback Home</h1>
	<h2>Most recent articles</h2>
	
	<?php for($i = 0; $i < 5; $i++):?>
		<?php $article = $articles[$i]?>
		<div id="article">
		<table class="article_Table">
		<tr>
		<?php if(!($article->imgRaw == '')):?>
		<td class="article_Img"><?php echo "<a href=".base_url().'userimages/'.$article->imgRaw.$article->imgExt.'>'."<img src=".base_url().'userimages/thumbs/'.$article->imgRaw.'_thumb'.$article->imgExt.' border="0"'.'></a>';?></td>
		<?php endif;?>
		</tr>
		<tr>
		<td class="article_Title"><?php echo anchor("articles/id/$article->articleID", $article->title); ?></td>
		</tr>
		<tr>
		<td class="article_Author_and_Date"><?php echo "Written by ".$this->user_model->getUsername($article->userID).' '.$article->date; ?></td>
		</tr>
		<tr>
		<?php $textPreNewLine = strstr($article->text, PHP_EOL, true)?>
		<td class="article_Text"><?php if($textPreNewLine == '') : echo substr($article->text, 0, 250) ?>
		<?php else : if(strlen($textPreNewLine) <= 250) : echo $textPreNewLine ?>
		<?php else : echo substr($textPreNewLine, 0, 250) ?>
		<?php endif; ?>
		<?php endif; ?></td>
		</tr>
		</table>
		</div>
		<hr />
	<?php endfor;?>
	
	
</div>